# 作者: 肖老师
# 2024年12月19日01时40分23秒
# xxxrlmk@163.com
def bitmap(list1):
    int_bitmap = 0
    result = []  # 去重后的元素存入该列表
    for i in list1:
        if int_bitmap & 1 << i + 1000:
            # i已经出现过了
            pass
        else:
            int_bitmap = int_bitmap | 1 << i + 1000  # 当i这个数出现时，就把对应的位设置为1,此处加1000是为了应对负数而进行的偏移
            result.append(i)
    print(result)
    print(len(result))


list1 = [95, 17, 3, 31, 86, 75, 56, 19, 38, 26,
         94, 54, 53, 72, 59, 61, 74, 58, 78, 60,
         64, 43, 52, 90, 84, 19, 92, 2, 71, 12,
         67, 10, 53, 85, -98, 24, 11, 41, 44, 55,
         10, 47, 43, 98, 9, 55, 18, 30, 44, 22,
         48, 15, 87, 28, 47, 18, 92, 3, 38, 87, 59,
         84, 76, 65, 82, 26, 47, 52, -58, 79, 50, 82,
         5, 71, 28, 30, 17, 51, 11, 58, 12, 54, 49, 73,
         24, 46, 99, 94, 93, 70, 12, 33, 19, 67, 62, 74, 61, 89, 91, 51]
bitmap(list1)
print('-' * 50)
print(len(list1))
s1 = set(list1)
print(len(s1))
